<%@ Page language="vb" Inherits="PubProject.emailtemplateproperties" CodeBehind="emailtemplateproperties.aspx.vb" AutoEventWireup="false" %>
<%@ Register TagPrefix="crm" Namespace="Microsoft.Crm.Application.Controls" Assembly="Microsoft.Crm.Application.Components.Application" %>
<html>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"/>
<title>E-mail Template Type</title>
<cnt:AppHeader runat="server" id="crmHeader"/>
<link rel="stylesheet" type="text/css" href="/_common/styles/select.css">
<script language="javascript">

	function applychanges()
	{
		var sURL = "/Tools/EmailTemplateEditor/emailtemplateeditor.aspx?templateTypeCode=" + templateType.returnValue + "&isPersonal=<%= Request.QueryString["isPersonal"] %>";
		
		// launch form for object type, using the dialogs opener which is passed in
		//
		if (window.dialogArguments)
		{
			window.dialogArguments.openStdWin(sURL, buildWinName(), 750, 500);
		}
		else
		{
			openStdWin(sURL, buildWinName(), 750, 500);
		}

		window.close();
	}
	
	
	function document.onkeydown()
	{
		if (event.srcElement.tagName != "BUTTON" && event.keyCode == 13)
		{
			event.returnValue = false;

			applychanges();
		}
		else if (event.keyCode == 116)
		{
			event.keyCode =0;
			event.returnValue = false;	
		}
	}


	function cancel()
	{
		window.close();
	}
	
</script>
</head>
<body>
<frm:DialogForm id="crmForm" runat="server">
	<table cellpadding="0" cellspacing="5" width="100%">
		<col width="90"></col>
		<tr>
			<td>Template Type</td>
			<td>
				<crm:AppPicklistControl id="templateType" AutoBinding="false" runat="server" Type="custom"/>
			</td>
		</tr>
	</table>
</frm:DialogForm>
</body>
</html>